﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Template.Master"
    Inherits="System.Web.Mvc.ViewPage<IArticle>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div region="center" style="width: 500px; height: 100%; padding: 1px; position: relative;
        overflow-y: auto">
        <div id="jqeasyui-form" style="height: 100%; position: relative;">
            <form action="<%=Url.Action("Create","Article") %>" method="POST" enctype="multipart/form-data">
            <%=Html.HiddenFor(o=>o.CategoryId) %>
            <fieldset>
                <p>
                    <label>
                        文章标题:</label><input type="text" name="MainTitle" style="width: 400px" class="easyui-validatebox"
                            required="true" value="<%=Model.MainTitle %>" /></p>
                <p>
                    <label>
                        文章副标题:</label><input type="text" name="SubTitle" style="width: 400px" class="easyui-validatebox"
                            required="true" value="<%=Model.SubTitle %>" /></p>
                <p style="display: none">
                    <label>
                        是否推荐:</label><%=Html.CheckBoxFor(o=>o.IsRecommend) %>
                </p>
                <p style="display: none">
                    <label>
                        是否停用:</label><%=Html.CheckBoxFor(o=>o.IsClosed) %>
                </p>
                <p style="display: none">
                    <label>
                        语言:</label><select id="cc" name="Culture" editable="false">
                        </select>
                </p>
                <p>
                    <label>
                        发布时间:</label><input type="text" style="width: 200px" id="CreateTime" name="CreateTime"
                            value="<%=Model.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") %>" />
                </p>
                <p>
                    <label>
                        图片:</label><input type="file" value="浏览" name="articleImage" />
                </p>
                <p>
                    <label>
                        小图片:</label><input type="file" value="浏览" name="articleSmallImage" /><span></span>
                </p>
                <p>
                    <label>
                        文章内容:</label>
                    <span class="span-textarea">
                        <textarea name="Content" id="Content" style="width: 500px; height: 400px;"><%=Model.Content %></textarea>
                    </span>
                </p>
                <p>
                    <label>
                        &nbsp;</label>
                    <input type="submit" value="保存" /></p>
            </fieldset>
            </form>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link rel="stylesheet" href="/Content/Widget/kindeditor/plugins/code/prettify.css" />
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/kindeditor.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/lang/zh_CN.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/plugins/code/prettify.js"></script>
    <script type="text/javascript">

        KindEditor.ready(function (K) {
            var editor1 = K.create('#Content', {
                cssPath: '/Content/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '<%=Url.Action("UploadFileArticleJson") %>',
                fileManagerJson: '<%=Url.Action("FileManagerArticleJson") %>',
                allowFileManager: true,
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                }
            });

        });
        $(function () {
            $('#CreateTime').datetimebox({
                showSeconds: false
            });
            $('#cc').combobox({
                url: '<%=Url.Action("GetCultureComboBoxJson","System",new{value=Model.Culture}) %>',
                valueField: 'id',
                textField: 'text'
            });
        });
    </script>
</asp:Content>
